.login{
    height: 100%;
    background-image: linear-gradient(to right,rgba($color-white,0),rgba($color-white,.3)),url($bcg);
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    flex-direction: column;

    @include respond(tab-port){
        min-height: 100%;
    }
}

.login-header, .logo{
    height: 60px;
    width: auto;
    position: absolute;
    top: 3rem;
    left: 8%;

    & h1{
        letter-spacing: .5rem;
    }

    @include respond(tab-land){
        height: 1.5rem;
        position: relative;
        top: 1.8rem;
    }
}

.logo-text{
    letter-spacing: .3rem;
    color: $color-primary;
}

.login-box{
    position: absolute;
    top: 0%;
    transform: translate(50%,50%);
    right: 25%;
    text-align: center;
    width: 25rem;
    background-color: rgba($color-white, $alpha: .8);
    border-radius: .6rem;
    box-shadow: $shadow-light;

    @include respond(tab-land){
        position: relative;
        transform: translate(0,0);
        top: 0;
        right: 0;
        width: 80%;
        margin: 0 auto;
        margin-top: 10%;
    }

    @include respond(phone){
        position: relative;
        width: 100%;
        transform: translate(0,0);
        top: 0;
        right: 0;
        margin-top: 30%;
    }

    &__form{
        width: 100%;
        padding: 2rem;

        &__group:not(:last-child){
            margin-bottom: 2rem;
        }
        &__group {
            & p{
                text-align: left;
                font-size: 1rem;
                margin-bottom: .5rem;
            }
        }

        &--title{
            font-size: 1.5rem;
            font-weight: 700;
            display: inline-block;
            color: rgba($color-primary-light,.8);
            letter-spacing: .2rem;
            transition: all .2s;
            cursor: pointer;
        }

        &--description{
            font-size: 1rem;
            margin: 1rem auto 1.5rem;
            color: $color-grey-dark;
            letter-spacing: .2rem;
        }

        
        &__input{
            font-family: inherit;
            font-size: 1rem;
            padding: .5rem 2rem;
            border-radius: 2px;
            background-color: $color-white;
            border: 1px solid $color-grey-light-1;
            border-bottom: 3px solid transparent;
            width: 100%;
            display: block;
            color: inherit;
            transition: all .3s;
    
            &:focus{
                outline: none;
                box-shadow: 0 1rem 2rem rgba($color-black, .1);
                border-bottom: 3px solid $color-primary;
            }
    
            &:focus:invalid{
                border-bottom: 3px solid $color-secondary-dark;
            }
    
            &::-webkit-input-placeholder{
                color: $color-grey-dark-2;
            }

            @include respond(tab-port){
                width: 100%;
            }
        }
    }
}

.login-btn{
    &,
    &:link,
    &:visited {
        width: 100%;
        text-decoration: none;
        padding: .5rem 2rem;
        transition: all .2s;
        position: relative;
        border-radius: 10rem;
        font-size: 1.2rem;
        background-image: linear-gradient(to right bottom, $color-primary,$color-primary-dark);

        //Change for <button> element
        border: none;
        cursor: pointer;
    
        @include respond(phone){
            font-size: 1rem;
            padding: .8rem 2rem;
        }
    }
    &:active,
    &:focus{
        outline: none;
        transform: translateY(-1px);
        box-shadow: 0 .5rem 1rem rgba($color-black,.2);
    }
    &:hover{
        transform: translateY(-3px);
        box-shadow: 0 1rem 2rem rgba($color-black,.2);
        &::after{
            transform: scaleX(1.4) scaleY(1.6);/* 放大或缩小元素 */
            opacity: 0;
        }
    }
    &::after{
        /* 跟该类有关的可以被第一个找到relative的元素为定位 */
        content: "";
        display: inline-block;
        height: 100%;
        width: 100%;
        border-radius: 10rem;
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
        transition: all .4s;
    }
    &--primary{
        background-color: $color-primary;
        color: $color-white;
        &::after{
            background-color: $color-primary;
        }
    }

    &--animated{
        animation: moveInBottom .5s ease-out .75s ;
        animation-fill-mode: backwards;/* 动画开始前不会应用样式 */
    }
}

.footer{
    width: 100%;
    height: 5rem;
    background-color: rgba($color-white,.6);
    text-align: center;
    position: fixed;
    bottom: 0;

    & p {
        font-size: .8rem;
        margin-top: .5rem;

        &:first-child {
            margin-top: 1rem;
        }
    }
    @include respond(phone){
        display: none;
    }
}

//validate input
.validate-input {
    position: relative;
  }
  
  .alert-validate::before {
    content: attr(data-validate);
    position: absolute;
    max-width: 70%;
    background-color: white;
    border: 1px solid orangered;
    border-radius: 13px;
    padding: 4px 25px 4px 10px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    right: 8px;
    pointer-events: none;
  
    font-family: Poppins-Medium;
    color: orangered;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
  
    visibility: hidden;
    opacity: 0;
  
    -webkit-transition: opacity 0.4s;
    -o-transition: opacity 0.4s;
    -moz-transition: opacity 0.4s;
    transition: opacity 0.4s;
  }
  
  .alert-validate::after {
    content: "\f06a";
    font-family: FontAwesome;
    display: block;
    position: absolute;
    color: orangered;
    font-size: 15px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    right: 13px;
  }
  
  .alert-validate:hover:before {
    visibility: visible;
    opacity: 1;
  }
  
  @media (max-width: 992px) {
    .alert-validate::before {
      visibility: visible;
      opacity: 1;
    }
  }